package com.aaa.controller;

import com.aaa.entity.OMS_Order_Return_Reason;
import com.aaa.service.OMS_Order_Return_ReasonService;

import java.util.List;
import javax.annotation.Resource;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({"oms_order_return"})
public class OMS_Order_Return_ReasonController {
    @Resource
    OMS_Order_Return_ReasonService oms_order_return_reasonService;

    public OMS_Order_Return_ReasonController() {
    }

    @RequestMapping({"list"})
    public List<OMS_Order_Return_Reason> list() {
        return this.oms_order_return_reasonService.list();
    }

    @RequestMapping({"select"})
    public List<OMS_Order_Return_Reason> select(String createTime) {
        return this.oms_order_return_reasonService.select(createTime);
    }

    @RequestMapping({"updAll"})
    public Integer updAll(String name, Integer id, Integer status) {
        return this.oms_order_return_reasonService.updAll(name, id, status);
    }

    @RequestMapping({"add"})
    public Integer add(String name, Integer status) {
        return this.oms_order_return_reasonService.add(name, status);
    }

    @RequestMapping({"del"})
    public boolean del(Integer id) {
        return this.oms_order_return_reasonService.removeById(id);
    }

    @RequestMapping("findPage")
    public List<OMS_Order_Return_Reason> findPage(@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "size", defaultValue = "10") int size) {
        Page<OMS_Order_Return_Reason> paged = new Page<>(page, size);
        List<OMS_Order_Return_Reason> jobInfos = oms_order_return_reasonService.selectPage(paged);
        return jobInfos;
    }
}
